<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    </head>
    <body>
        <p>点击按钮就可以执行 <em>displayDate()</em> 函数。</p>
        <button id="myBtn">点击这里</button>
        <script>
//            document.getElementById("myBtn").onclick = function() {
//                displayDate()
//            };
            function displayDate() {
                document.getElementById("demo").innerHTML = Date() + "..2";
            }
            document.getElementById("myBtn").onclick = displayDate;
        </script>
        <p id="demo"></p>
    </body>
</html> 
